﻿@{
    ViewBag.Title = "EditPwd";
}
@section scripts
{
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
}

            @Html.Partial("~/Views/Modular/Toolbars.cshtml")
        <div name="Base" title="重置密码" style="height:100%;overflow:hidden;margin-top:15px;margin-left:20px">
            <table style="width:100%;">
                <tr>
                    <td width="80px" height ="50px" align="right">
                        原 密 码：</td>
                    <td width="190px" height ="50px">
                        <input name="SPassword" id="SPassword" class="mini-password" style="width:190px;"  value="" TabIndex="1"/>
                    </td>
                </tr>
                <tr>
                    <td width="80px" height ="50px" align="right">
                        新 密 码：</td>
                    <td width="190px" height ="50px">
                        <input name="FPassword" id="FPassword" class="mini-password" style="width:190px;"  value="" TabIndex="2"/>
                    </td>
                </tr>
                <tr>
                    <td width="80px" height ="50px" align="right">
                        确认密码：</td>
                    <td width="200px" height ="50px">
                        <input id="FRePassword" name="FRePassword" class="mini-password "  style="width:190px;"  TabIndex="3"/>
                    </td>
                </tr>
            </table>
        </div>
    <input type="hidden" id="FItemID" value="" />
<script>
    mini.parse();
    $(function () {
        mini.getbyName("SPassword").focus();
    });

    function SaveInfo() {
        var password = mini.getbyName("FPassword").getValue();
        var password2 = mini.getbyName("FRePassword").getValue();
        if (password != password2) {
            mini.alert("输入的新密码与确认密码不一致！");
            return;
        }
        var pwdreg = /[a-zA-Z0-9]{6,16}/;
        if (!pwdreg.test(password)) {
            mini.alert("密码由大小写字母及数字组成，且6至16个字符。");
            return;
        }
        var datajson = '{ FItemID:'+ $("#FItemID").val()+', spwd:\''+ mini.getbyName("SPassword").getValue()+'\', fpwd:\''+ password+'\', frpwd:\''
                +password2+'\', mSystemAppID:\'' +parent.window.getSystemAppID()+'\' }';
        $.post("Editpassword", { json: datajson }, function (data) {
            var mdata = mini.decode(data);
            if (mdata.status == 1)
                mini.showTips({ content: "密码修改成功!", state: "success", x: "center", y: "top", timeout: 3000 });
            else
                mini.alert(mdata.error);
        });
    }

    function SetInfoData(data) {
        $("#FItemID").val(data.FItemID);
    }
</script>